/*
 * share_mem.h
 *
 *  Created on: Feb 23, 2023
 *      Author: yglc
 */

#ifndef SHARE_MEM_H_
#define SHARE_MEM_H_

#include <pthread.h>
//引入队列的头文件
#include <queue>
using namespace std;


class CShareMem {
public:
	CShareMem();
	virtual ~CShareMem();

	int CShareMem_Init();

	int CShareMem_Read_Byte(int addr,unsigned int &value);
	int CShareMem_Write_Byte(int addr,unsigned int value);

	int CShareMem_Read(int addr,int size,unsigned int *buffer);
	int CShareMem_Write(int addr,int size,unsigned int *buffer);
	int CShareMem_Read2(int addr,int size,unsigned int *buffer);

	int CShareMem_Close();
	int MY_SYNC();

	unsigned int *m_map_sharemem;
	int m_fd;
	pthread_mutex_t mutex_t;


};
extern CShareMem * g_share_mem;

#endif /* SHARE_MEM_H_ */
